home *** CD-ROM | disk | FTP | other *** search
- /* util.c - utility functions needed by merge programs */
- #include "stdio.h"
- #include "cminor.h"
-
- int swap_str(s1,s2) /* swap two strings */
- char s1[] ;
- char s2[] ;
- {
- char t[68] ; /* scratch space for one string */
-
- strcpy(t ,s1) ; /* exchange strings */
- strcpy(s1,s2) ; /* assumes that there is room */
- strcpy(s2,t ) ;
- }
-
- /* make up a scratch file name */
- int mkname(file_name,prefix,run_no)
- char file_name[] ; /* store file name here */
- char prefix[] ; /* something like "scra" */
- int run_no ; /* append this number to prefix */
- {
- sprintf(file_name,"%s.%03d",prefix,run_no) ;
- }
-
-
- delfile(file_spec) /* delete a file */
- char file_spec[] ;
- {
- unlink(file_spec) ;
- }
-
-